﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SeatSelect.aspx.cs" Inherits="Movie.web.SeatSelect" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
  <%--  <script type="text/javascript">
        window.addEventListener("load", function () {
            //通过Id获取table
            var table = document.getElementById('<%= DataList1.ClientID %>');
            //遍历table所有行
            for (var i = 0; i < table.rows.length; i++) {
                //获取每一行的所有img标签对象
                var imgs = table.rows[i].getElementsByTagName("img");
                //遍历每一行img标签对象
                for (var j = 0; j < imgs.length; j++) {
                    //为每一个img对象添加事件处理方法
                    imgs[j].addEventListener("click", function (e) {
                        this.src = "~/images/covers/selected.jpg";
                    }, false);

                }

            }

        }, false);
    
    </script>--%>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:DataList ID="DataList1" runat="server">
        <ItemTemplate>
            <asp:ImageButton ID="ImageButton1" runat="server" Height="32px" 
                ImageUrl='<%# GetPicoath(Eval("SeatState")) %>' 
                Visible='<%# Convert.ToBoolean(Eval("IsValid")) %>' Width="32px" 
                oncommand="ImageButton1_Command" CommandArgument='<%#Eval("SeatID") %>' />

         <%--   <asp:Image ID="Image1" runat="server" Height="32px" 
                ImageUrl='<%# GetPicoath(Eval("SeatState")) %>' 
                Visible='<%# Convert.ToBoolean(Eval("IsValid")) %>' Width="32px" />  --%>      
        </ItemTemplate>
        </asp:DataList>

          <asp:Button ID="Button1" runat="server" Text="提交" onclick="Button1_Click" /> 

          <asp:Button ID="Button2" runat="server" Text="查看订单" 
            onclick="Button2_Click"  /> 
    </div>
    </form>
</body>
</html>
